<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script language="JavaScript">
        function delWeather(yyy) {
            var isSelected = false;
            for (var i=0;i<=yyy.id.length;i++){
                if ( yyy.id[i].checked == true ){
                    isSelected = true;
                    break;
                }
            }
            if (isSelected==true){
                var yesOrNo = confirm('您真的要干掉它们吗？');
                if (yesOrNo){
                    yyy.submit();
                }
            }else {
                alert('请先勾上您要删除的记录');
            }
        }
    </script>
</head>
<body>

<form action="delWarnWeathers">
<table width="1000px" border="1">
    <tr align="center" style="background: blue;color: azure">
        <td>选择</td>
        <td>编号</td>
        <td width="120px">预警级别</td>
        <td>发布时间</td>
        <td>持续时间(天数)</td>
        <td width="150px">影响区域</td>
        <td width="250px">气象描述</td>
    </tr>
<c:forEach items="${weathersList}" var="weather" varStatus="line">
    <tr${line.count%2==1?" style='background: antiquewhite'":""}>
        <td align="center"><input type="checkbox" name="id" value="${weather.wno}"></td>
        <td align="center">${weather.wno}</td>
        <td align="center">${weather.wtype}</td>
        <td align="center">
            <fmt:formatDate value="${weather.wdate}" pattern="yyyy-MM-dd HH:mm"></fmt:formatDate>
        </td>
        <td align="center">${weather.wdays}</td>
        <td>${weather.warea}</td>
        <td>${weather.winfo}</td>
    </tr>
</c:forEach>
</table>
    <input type="text" onclick="javascript:delWeather(this.form)" value="删除预警信息" style="outline:none;border:none"></input>
</form>

</body>
</html>
